Products Onboarding: Stay on My Store screen after tapping on banner CTA #8140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #8137
Description
This PR updates the navigation after tapping the products onboarding banner CTA. Now we start the product creation flow immediately, without navigating to the Products tab first.
Changes
PassthroughSubjectto the dashboard view model (addProductTrigger), used to trigger the add product flow when the CTA is tapped.onProductCreated()callback to the product form view model, which is called when a new product is added so we can clear and resync the dashboard banner.MainTabBarController.presentAddProductFlow()that's no longer needed.Testing
Because the banner is currently in an experiment, the easiest way to test it is to first comment out the experiment check:
woocommerce-ios/WooCommerce/Classes/ViewRelated/Dashboard/DashboardViewModel.swift
Lines 154 to 156 in 5ffc0a3
Then proceed with testing:
product_list_add_product_button_tappedwas tracked.Note: If you go back without saving or publishing the product, you can see you are returned to the My Store screen and the banner is still visible.
Screenshots
Tapping the banner CTA without product templates enabled:
BannerCTANav-NoTemplate.mp4
Tapping the banner CTA with product templates enabled:
BannerCTANav-WithTemplate.mp4
Submitter Checklist
Update release notes:
RELEASE-NOTES.txtif necessary.